import request from "@/utils/request.js";

// 登录
export const login = (data) => {
  return request({
    url: "/mini/loginMini",
    data,
    method: "GET",
  });
};

// 获取banner
export const getBanner = () => {
  return request({
    url: "/home/banner",
    method: "GET",
  });
};

// 获取类目
export const getCategory = () => {
  return request({
    url: "/home/category",
    method: "GET",
  });
};

// 获取首页在建项目
export const getZProject = (data) => {
  return request({
    url: "/home/order",
    method: "GET",
    data,
  });
};

// 在建项目列表
export const getZProjectList = (data) => {
  return request({
    url: "/home/orderPage",
    method: "GET",
    data,
  });
};

// 获取案例
export const getCase = (data) => {
  return request({
    url: "/home/project",
    method: "GET",
    data,
  });
};

// 获取案例列表
export const getCaseList = (data) => {
  return request({
    url: "/home/projectPage",
    method: "GET",
    data,
  });
};

// 获取案例详情
export const getCaseDetail = (data) => {
  return request({
    url: "/home/projectInfo/" + data,
    method: "GET",
  });
};

// 推荐服务
export const reServer = (data) => {
  return request({
    url: "/home/service",
    method: "GET",
    data,
  });
};

// 获取服务详情
export const getServerDetail = (data) => {
  return request({
    url: "/home/serviceInfo/" + data,
    method: "GET",
  });
};

// 服务类目列表
export const getCateList = (data) => {
  return request({
    url: "/home/categoryPage",
    method: "GET",
    data,
  });
};

// 服务列表
export const getServerList = (data) => {
  return request({
    url: "/home/servicePage",
    method: "GET",
    data,
  });
};

export const serverPointList = () => {
  return request({
    url: "/home/addrList",
    method: "GET",
  });
};

// 下单
export const createOrder = (data) => {
  return request({
    url: "/user/order",
    method: "POST",
    data,
  });
};

// 提交需求
export const submit = (data) => {
  return request({
    url: "/user/demand",
    method: "POST",
    data,
  });
};

// 我的需求列表
export const getSubmitList = (data) => {
  return request({
    url: "/user/demandPage",
    method: "get",
    data,
  });
};

// 收藏
export const collect = (data) => {
  return request({
    url: "/user/collect",
    method: "POST",
    data,
  });
};

// 我的收藏列表
export const getCollect = (data) => {
  return request({
    url: "/user/collectPage",
    method: "get",
    data,
  });
};

// 获取排行榜
export const getSort = (data) => {
  return request({
    url: "/user/rank",
    method: "get",
    data,
  });
};

// 获取用户信息
export const getUserInfo = (data) => {
  return request({
    url: "/mini/userInfo",
    method: "GET",
    data,
  });
};

// 修改用户信息
export const updateUser = (data) => {
  return request({
    url: "/mini/updateUserInfo",
    method: "POST",
    data,
  });
};

// 订单列表
export const getOrderList = (data) => {
  return request({
    url: "/user/orderList",
    method: "get",
    data,
  });
};

// 订单详情
export const getOrderDetail = (data) => {
  return request({
    url: "/user/orderInfo/" + data,
    method: "get",
  });
};

// 支付
export const pay = (data) => {
  return request({
    url: "/user/pay/" + data,
    method: "post",
  });
};

// 提现
export const withdrawal = (data) => {
  return request({
    url: "/user/withdrawal",
    method: "POST",
    data,
  });
};

// 提现列表
export const withdrawalList = (data) => {
  return request({
    url: "/user/withdrawalPage",
    method: "get",
    data,
  });
};

// 佣金变更记录
export const bgList = (data) => {
  return request({
    url: "/user/cashRecordPage",
    method: "get",
    data,
  });
};

// 审核详情
export const txDetail = (data) => {
  return request({
    url: "/user/withdrawalInfo/" + data,
    method: "get",
  });
};

// 日志详情
export const logDetail = (data) => {
  return request({
    url: "/user/logInfo/",
    method: "get",
    data,
  });
};

// 团队列表
export const teamList = () => {
  return request({
    url: "/user/teamList",
    method: "get",
  });
};

// 小铃铛数字
export const sNumber = () => {
  return request({
    url: "/user/withdrawalNum",
    method: "get",
  });
};

// 获取历史记录
export const getHistory = () => {
  return request({
    url: "/user/history",
    method: "get",
  });
};

// 获取历史记录
export const clearHistory = () => {
  return request({
    url: "/user/delHistory",
    method: "get",
  });
};

// 服务海报
export const serHb = (data) => {
  return request({
    url: "/user/serviceCode/" + data,
    method: "get",
  });
};

// 个人中心海报
export const userHb = () => {
  return request({
    url: "/user/qrCode",
    method: "get",
  });
};

// 协议
export const proxy = (data) => {
  return request({
    url: "/home/configKey/" + data,
    method: "get",
  });
};

// 获取分销商
export const getFx = () => {
  return request({
    url: "/home/distributor",
    method: "get",
  });
};

// 跟进需求详情
export const getRequirementDetail = (data) => {
  return request({
    url: "/user/demandInfo/" + data,
    method: "get",
  });
};

